#!/usr/bin/env node
const path = require('path');

const fs = require('fs-extra');

// console.log(process.argv);
// console.log(process.argv[2] == 'init');

const cwd = process.cwd();
const sourcePath = path.join(cwd, 'node_modules/wap-eslint');

fs.copy(path.join(sourcePath, 'eslintrc-init.js'), path.join(cwd, '.eslintrc.js'))
	.then(() => console.log('init .eslintrc.js success!'))
	.catch(err => console.error(err));

fs.copy(path.join(sourcePath, 'prettierrc-init.js'), path.join(cwd, '.prettierrc.js'))
	.then(() => console.log('init .prettierrc.js success!'))
	.catch(err => console.error(err));
